package com.zwh.rabbitmq.config.dto;


import com.zwh.rabbitmq.config.BooleanEnum;

/**
 * @author zwh
 * @date 2021/12/1 18:39
 **/
public class RabbitmqMessageBuilder {
    /**
     * Workbook
     */
    private RabbitmqMessageRecordDto rabbitmqMessageRecordDto;

    public RabbitmqMessageBuilder() {
        this.rabbitmqMessageRecordDto = new RabbitmqMessageRecordDto();

        // 选填
        rabbitmqMessageRecordDto.setBusinessModule("");
        rabbitmqMessageRecordDto.setBusinessKey("");
        rabbitmqMessageRecordDto.setRetryTimes(0);
        rabbitmqMessageRecordDto.setMessageStatus(BooleanEnum.YES.getId());
    }

    public RabbitmqMessageBuilder content(String content) {
        rabbitmqMessageRecordDto.setContent(content);
        return this;
    }

    public RabbitmqMessageBuilder sendMessageId(String sendMessageId) {
        rabbitmqMessageRecordDto.setSendMessageId(sendMessageId);
        return this;
    }

    public RabbitmqMessageBuilder exchangeName(String exchangeName) {
        rabbitmqMessageRecordDto.setExchangeName(exchangeName);
        return this;
    }
    public RabbitmqMessageBuilder routingKey(String routingKey) {
        rabbitmqMessageRecordDto.setExchangeName(routingKey);
        return this;
    }
    public RabbitmqMessageBuilder businessModule(String businessModule) {
        rabbitmqMessageRecordDto.setBusinessModule(businessModule);
        return this;
    }
    public RabbitmqMessageBuilder businessKey(String businessKey) {
        rabbitmqMessageRecordDto.setBusinessKey(businessKey);
        return this;
    }

    public RabbitmqMessageRecordDto build() {
        return rabbitmqMessageRecordDto;
    }


}
